#include "fxcc/yml/Serializer.h"
#include "fxcc/core/graph/common/Frustum.h"

using namespace fxcc::yml;
using CType = fxcc::graph::common::Frustum;;

template<>
void Serializer::Encode<CType>(YAML::Node& node, const CType& inst)
{
	SetVariable<float>(node, "fovy", inst.fovy);
	SetVariable<float>(node, "aspect", inst.aspect);
	SetVariable<float>(node, "nearZ", inst.nFar);
	SetVariable<float>(node, "farZ", inst.nFar);

}


template<>
bool Serializer::Decode<CType>(const YAML::Node& node, CType& inst)
{

	GetVariable<float>(node, "fovy", inst.fovy);
	GetVariable<float>(node, "aspect", inst.aspect);
	GetVariable<float>(node, "nearZ", inst.nFar);
	GetVariable<float>(node, "farZ", inst.nFar);

	return true;
}
